l-systems & whimsy

elisse chow | november 16, 2023 — december 13, 2023

to my sister Janine, who taught me so much about the beauty of math growing up—thank you

milestones ↓

While it's been incredibly difficult at times, I'm extremely proud of what I've created. In all honesty, I went into this project a little discouraged by my previous attempt of working with Lindenmayer Systems in the sequencer project, but I wanted another shot at it, and I'm glad I took it on.

To give a rundown of the project, its centered entirely on Lindenmayer Systems—a parallel rewriting system created by biologist Aristid Lindenmayer. My system follow traditional TurtleBot dynamics to draw out the visuals, and I've also mapped out a sonification system that similarly translates text audio. I don't think I can explain it better than what the Wikipedia page on L-systems says, so I'll copy over what they have to say and also give an example that they have:
"An L-system consists of an alphabet of symbols that can be used to make strings, a collection of production rules that expand each symbol into some larger string of symbols, an initial "axiom" string from which to begin construction, and a mechanism for translating the generated strings into geometric structures." — L-Systems Wikipedia page

Koch Curve

There's a lot more on that page, but we should be good with this to begin. I do recommend taking a read through of that page! It's really cool to see what types of fractals and/or biological growth can be described using a system like this :D.

Before we finally get into the video, I'm not entirely sure why I chose the name "l-systems & whimsy". I think I maybe find the creation tool a bit whimsical and the real-time aspect quite fun. A disclaimer: I have found it crashes sometimes with segmentation faults unfortunately, so be careful with the Barnsley fern preset. Please enjoy designing with math!

Sierpinski Arrowhead, Generation 6

Hexagonal Gosper, Follow Cam Angle

Penrose Tiling, Drawing in progress

instructions

download files here!

run with lsystems_and_whimsy.ck.

platform: MacOS

Control Panel & Information Overview

This is a long gui, so I'll break it down as best as I can.
  1. LSystems Generator
    1. Axiom: Text input box where you can define the "axiom" of the l-system. This is the starting point and will be the definition for generation 0.
    2. Alphabet: Text input box where you can define your alphabet of characters that you want to map the processing behavior for. Will filter out duplicate letters if applicable.
  2. Rule Editing
    1. Currently editing: Dropdown selection, where you can select one of the letters defined in the Alphabet text input to edit their rules.
    2. String replace: Text input, the rule used by the central lsystem to replace the character with a longer string of other characters.
    3. Drawing Rule: Dropdown selection (forward, left, right, push, pop, move, none), determines how the TurtleBot will react to the character that was just seen. See the bullets bellow for info on what each of these rules mean.
      • forward | F/G: Moves the Turtlebot forward and draws a line
      • left | +: Rotates the Turtlebot left by a set angle
      • right | -: Rotates the Turtlebot right by a set angle
      • push | [: Saves the current state to a stack
      • pop | ]: Pops off the most recently saved state from the stack
      • move (usually lowercase): Moves the Turtlebot forward without drawing a line
    4. Audio Rule: Dropdown selection (play, increment, decrement, louder, softer, speed up, slow down, random preset, change instrument, none), determines how the sonification system will react to the character that was just seen.
    5. Reset rules: Button, resets the rules for the standard characters in the alphabet.
  3. Generation Settings
    1. Angle: float slider, determines the angle that the turtlebot turns with every "+"/"-"
    2. Set generation: int slider, set the number of the current generation that you would like to visualize.
    3. Stepduration: int slider, set the time (ms) it takes for each step in the animation.
    4. Begin: button, begins the animation & audio over time. Will restart if pressed again.
    5. Replace: button, begins a new animation of currently setup l-system without erasing the previous lines that have already been drawn.
    6. Stop: button, stops the animation/audio.
  4. Presets: Each of these buttons preloads the system with a working l-system. Unfortunatley, the barnsley fern is a little buggy T^T.
  5. Experimental
    1. Show Turtlebot Toggle: Shows/hides the turtlebot sphere shown at the most recent point added to the visual.
    2. Follow Cam Toggle: Switches the camera perspective between the top view and a 1st person view following the turtlebot drawing.

a final reflection

I am incredibly thankful—for this class because it has been so wonderful, for CCRMA for existing, for everyone because you have all been extremely supportive and uplifting. I don't think I've ever had a class that I've felt so much love for at Stanford before, and I doubt that I'll find anything like this in my last two quarters to come. Take care everyone, it's been such an honor to work with you this quarter. — elisse <333


Milestone 3: Minimal Essential System

Download here!

Run with chuck m3.ck.

Milestone 2: Core Mechanics

Download here!

Run with chuck lsystem.ck. No interactions are implemented yet :(
I've set up the infrastructure to do the simpler L-Systems, but haven't gotten the push/popping ones working for like binary fractal trees. For sonification, I can make the push and pop characters ('[', ']') play things in parallel to add more dimension to the playing music.

Milestone 1: Program Proposals

Idea 1: Lindenmayer Systems - a contemplation on recursive structures & time (?)

Though I couldn't get this working for the sequencer, I think I'd like to return to this idea of sonifying recursive structures defined by Lindenmayer systems and/or fractals. In terms of interactivity, I wonder if having a 1st person view of visuals would be interesting where the movement of the user can influence the generation and appearance of the l-system. Warping visuals and sound to the speed of their movement. I think I'd like this to be both a tool for sound synthesis but also an immersive environment to be at calm. I've linked some papers/articles that I've come across that are particularly relevant to my idea which I hope to reference in my work.
References:
Growing Music: Musical Interpretations of L-Systems | Peter Worth, Susan Stepney
Non-Standard Sound Synthesis with L-Systems | Stelios Manousakis
An Approach to Sound Synthesis with L-Systems | Nathan Ho

Idea 2: Musical Jigsaw Puzzles

Idea 3: Voice Controlled Escape Room

Things like volume, pitch impact the player's actions whether they turn right or left, zoom in or out on an object. I think it'd be interesting to include musically themed puzzles throughout like having to replicate musical motifs in order to acquire the key to exit the room or something like that.